<!doctype html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge" />
    <title>系统后台</title>
    <script src="__ROOT__/static/shophome/plugins/jquery-1.10.2.min.js?v=1.9.1"></script>
    <link href='__ROOT__/static/favicon.ico' rel='shortcut icon'>
    <link href="__ROOT__/static/admin/css/style.css{$js_debug}" rel="stylesheet" />
    <link href="__ROOT__/static/js/artDialog/skins/default.css{$js_debug}" rel="stylesheet" />
    <link rel="stylesheet" href="__ROOT__/Public/Admin/admin/css/font-awesome.min.css">
        <link rel="stylesheet" href="__ROOT__/Public/Admin/admin/css/animate.min.css">

     
     <link href="__ROOT__/Public/Plus/css/hdjs.css" rel="stylesheet" type="text/css">
     <!-- //日历 -->
       <script src="{$hostname}/Public/Plus/js/lhgcalendar.min.js" type="text/javascript"></script>
     <script src="__ROOT__/Public/Plus/js/hdjs.js" type="text/javascript"></script>
     <script src="__ROOT__/Public/Plus/layer/layer.js" type="text/javascript"></script>
     <!-- //公共的JS-FUNCTION函数 -->
     <script src="__ROOT__/Public/Plus/js/PublicVlidate.js" type="text/javascript"></script>
     <!-- //三级联动城市 -->
     
       <script src="__ROOT__/Public/Plus/js/PublicVlidate.js" type="text/javascript"></script>
  <script type="text/javascript">
  layer.config({
      extend: ['skin/moon/style.css'], //加载新皮肤
      skin: 'layer-ext-moon' //一旦设定，所有弹层风格都采用此主题。
  });
  </script>
    
  <block name="style"></block>
</head>
<body class="J_scroll_fixed">
<block name="body"></block>

<block name="script"></block>


</body>
</html>
<link href="__ROOT__/static/js/artDialog/skins/default.css{$js_debug}" rel="stylesheet" />


<block name="style">
  <script type="text/javascript">
    var catid = "12";
  </script>
  <style type="text/css">
    td{border:1px solid #000;}
    td{font-size: 12px;color: #000}
    td{color:#000;font-size: 16px;}
    /*.table_full{width: 500px;}*/
    td span{display: none}
    input{width: 70px;color: red;display: inline-block;float: left;}
    textarea{width: 100%;color: red}
    option{color: red;}
    select{color: red;}
    #pages{width: 100%;overflow: hidden;margin-bottom: 20px;border-bottom: 2px solid #000}
    #pages a{ display: block;width: 33px;height: 33px;text-align: center;float: left;border: 1px solid #ddd;line-height: 33px;}
    #pages a:hover{background: #EEEEEE}
    #pages span{display: block;width: 33px;height: 33px;text-align: center;float: left;border: 1px solid #ddd;line-height: 33px;} 
  </style>
</block>

<block name="body">
  <div class="wrap J_check_wrap">
  <div class="nav">
      <ul class="cc">
        <li class="current repush"><a href="javascript:;"><i class="fa fa-mail-reply-all"></i>重新上传</a></li>
      </ul>
    </div>
    <div id="pages">
      {$page}
    </div>
    <!-- <div><h1>请检查<span>红色</span>字的信息是否正确。如不正确双击红色字修改。悠 </h1></div> -->
   <form action="{:U('Recipients/creatApply')}" method="post" enctype="multipart/form-data" id="comfirmold" change="off">
      <input type="hidden" value="{$id}" name="excel_input_id">
      <div class="col-auto">
        <!-- <div class="h_a">excel表上传<a href="__ROOT__/Public/exceldemo/Recipients.xls">下载样表</a></div> -->
        <div class="table_full">
          <table cellspacing="0" cellpadding="0" style="">
            <col width="100">
            <col width="36">
            <col width="35">
            <col width="34">
            <col width="61">
            <col width="54">
            <col width="50" span="2">
            <col width="58">
            <col width="146">
            <col width="84">
     
        <tr height="26">
          <td colspan="10" height="26"><p style="float:left">学 校:</p><span class="student_school">{$re.student_school}</span> <input style="width:300px;" type="text" name="student_school" value="{$re.student_school}"></td>
      
          <td height="26">项目类型:
              <select name="item" id="" name="item">
              <?php foreach ($item as $key => $v): ?>
                <option value="{$v.id}" <?php if($re['item']==$v['id']){ echo "selected ='selected'";} ?>>{$v.name}</option>
                 <?php endforeach ?>
              </select></td>
        </tr>
        <tr height="30">
          <td height="30">学生姓名</td>
          <td colspan="3"><span class="student_name">{$re.student_name}</span> <input type="text" name="student_name" value="{$re.student_name}"></td>
          <td>性 别</td>
          <td>　<span class="student_sex">{$re.student_sex} </span> 

          <select name="student_sex" id="">
            <option value="1"  <?php if($re['student_sex']==1){ echo "selected ='selected'";} ?>>男</option>
            <option value="2"  <?php if($re['student_sex']==2){ echo "selected ='selected'";} ?>>女</option>
          </select>
          </td>
          <td>年龄</td>
          <td><span class="student_age">{$re.student_age}</span> <input type="text" name="student_age" value="{$re.student_age}"></td>
          <td>年级</td>
          <td><span class="student_grade">{$re.student_grade}</span>
          <select class="form-control input-medium" name="student_grade">

             <?php foreach (C('STUDENT_GRADE') as $k => $v): ?>
               <option value="{$k}" <?php if($re['student_grade']==$v){ echo "selected ='selected'";} ?>>{$v}</option>
             <?php endforeach ?>
                
          
          </select>

          <td rowspan="3" width="84"><img src="{$re.smeta_thumb}" style="width:160px;height:150px;" alt=""> <input style="width:100px;" type="text" name="smeta_thumb" value="{$re.smeta_thumb}"></td>
        </tr>
        <tr height="30">
          <td height="30">民族</td>
          <td colspan="3"><span class="nationName">{$re.nationName}</span> 
           <select class="form-control input-medium" name="student_nation">
             <?php foreach ($nation as $key => $v): ?>
                <option value="{$v.id}" <?php if($re['nationName']==$v['name']){?> selected="selected" <?php } ?>>{$v.name}</option>
             <?php endforeach ?>
              
          </select>
         
          <td>家庭住址</td>
          <td colspan="5"><span class="student_address">{$re.student_address}</span> <input type="text" style="width:400px;" name="student_address" value="{$re.student_address}"></td>
        </tr>
        <tr height="33">
          <td height="33">家长姓名</td>
          <td colspan="3"><span class="patriarch_name">{$re.patriarch_name}</span><input type="text" name="patriarch_name" value="{$re.patriarch_name}"></td>
          <td>家长电话</td>
          <td colspan="3"><span class="patriarch_phone">{$re.patriarch_phone}</span><input style="width:200px;" type="text" name="patriarch_phone" value="{$re.patriarch_phone}"></td>
          <td width="58">家长签字</td>
          <td>同意公布家庭信息</td>
        </tr>
        <tr height="33">
          <td height="33">家庭成员姓名</td>
          <td colspan="3">称  呼</td>
          <td>年龄</td>
          <td colspan="4">职业及基本情况</td>
          <td>资料提供日期</td>
          <td><span class="time">{$re.time}</span> <input type="text" value="{$re.time}" name="time"></td>
        </tr>
        <tr height="23">
          <td height="23" width="100"><span class="family_name_0">{$re.family_name.0}</span><input type="text" name="family_name[]" value="{$re.family_name.0}"></td>
          <td colspan="3" width="105"><span class="family_relation_0">{$re.family_relation.0}</span><input type="text" name="family_relation[]" value="{$re.family_relation.0}"></td>
          <td width="61"><span class="family_age_0">{$re.family_age.0}</span><input type="text" value="{$re.family_age.0}" name="family_age[]"></td>
          <td colspan="4" width="212"><span class="family_remark_0">{$re.family_remark.0}</span><input type="text" name="family_remark[]" value="{$re.family_remark.0}"></td>
          <td width="146">养殖(种植)收入(年)</td>
          <td width="84"><span class="culture_earnings">{$re.culture_earnings}</span><input type="text" name="culture_earnings" value="{$re.culture_earnings}"></td>
        </tr>
        <tr height="23">
         <td height="23" width="100"><span class="family_name_1">{$re.family_name.1}</span><input type="text" name="family_name[]" value="{$re.family_name.1}"></td>
          <td colspan="3" width="105"><span class="family_relation_1">{$re.family_relation.1}</span><input type="text" name="family_relation[]" value="{$re.family_relation.1}"></td>
          <td width="61"><span class="family_age_0">{$re.family_age.1}</span><input type="text" value="{$re.family_age.1}" name="family_age[]"></td>
          <td colspan="4" width="212"><span class="family_remark_1">{$re.family_remark.1}</span><input type="text" name="family_remark[]" value="{$re.family_remark.1}"></td>
          <td width="146">打工收入(年)</td>
          <td width="84"><span class="work_earnings">{$re.work_earnings}</span> <input type="text" name="work_earnings" value="{$re.work_earnings}"></td>
        </tr>
        <tr height="23">
         <td height="23" width="100"><span class="family_name_2">{$re.family_name.2}</span><input type="text" name="family_name[]" value="{$re.family_name.2}"></td>
          <td colspan="3" width="105"><span class="family_relation_2">{$re.family_relation.2}</span><input type="text" name="family_relation[]" value="{$re.family_relation.2}"></td>
          <td width="61"><span class="family_age_2">{$re.family_age.2}</span><input type="text" value="{$re.family_age.2}" name="family_age[]"></td>
          <td colspan="4" width="212"><span class="family_remark_2">{$re.family_remark.2}</span><input type="text" name="family_remark[]" value="{$re.family_remark.2}"></td>
          <td width="146">养老金补助(年)</td>
          <td width="84"> <span class="pension_earnings">{$re.pension_earnings}</span><input type="text" name="pension_earnings" value="{$re.pension_earnings}"></td>
        </tr>
        <tr height="23">
        <td height="23" width="100"><span class="family_name_3">{$re.family_name.3}</span><input type="text" name="family_name[]]" value="{$re.family_name.3}"></td>
          <td colspan="3" width="105"><span class="family_relation_3">{$re.family_relation.3}</span><input type="text" name="family_relation[]" value="{$re.family_relation.3}"></td>
          <td width="61"><span class="family_age_3">{$re.family_age.3}</span><input type="text" value="{$re.family_age.3}" name="family_age[]"></td>
          <td colspan="4" width="212"><span class="family_remark_3">{$re.family_remark.3}</span><input type="text" name="family_remark[]" value="{$re.family_remark.3}"></td>
          <td width="146">低保补助(年)</td>
          <td width="84"> <span class="allowances_earnings">{$re.allowances_earnings}</span><input type="text" name="allowances_earnings" value="{$re.allowances_earnings}">　</td>
        </tr>
        <tr height="23">
        <td height="23" width="100"><span class="family_name_4">{$re.family_name.4}</span><input type="text" name="family_name[]" value="{$re.family_name.4}"></td>
         <td colspan="3" width="105"><span class="family_relation_4">{$re.family_relation.4}</span><input type="text" name="family_relation[]" value="{$re.family_relation.4}"></td>
          <td width="61"><span class="family_age_4">{$re.family_age.4}</span><input type="text" value="{$re.family_age.4}" name="family_age[]"></td>
          <td colspan="4" width="212"><span class="family_remark_4">{$re.family_remark.4}</span><input type="text" name="family_remark[]" value="{$re.family_remark.4}"></td>
          <td width="146">其他收入(年)</td>
          <td width="84"><span class="others_earnings">{$re.others_earnings}</span><input type="text" name="others_earnings" value="{$re.others_earnings}"></td>
        </tr>
        <tr height="23">
          <td rowspan="5" height="120" dir="RTL" width="100">家庭具体情况详细描述</td>
          <td colspan="8" rowspan="5" dir="RTL" width="270"><span style="text-align:left;" class="family_describle">{$re.family_describle}</span>
      
           <textarea  id="" cols="30" rows="10" name="family_describle">{$re.family_describle}</textarea>          </td>
          <td rowspan="2" width="146">有无其它公益组织资助(如果有请列出具体资助组织及资助金额)</td>
          <td rowspan="2" width="84">　 <span class="other_imburse_remark">{$re.other_imburse_remark}</span>
          
            <textarea id="" cols="30" rows="10" name="other_imburse_remark">{$re.other_imburse_remark}</textarea>            </td>
        </tr>
        <tr height="23"> </tr>
        <tr height="24">
          <td height="24" width="146">家庭生活支出(年)</td>
          <td width="84"><span class="living_expenditure_family">{$re.living_expenditure_family}</span><input type="text" name="living_expenditure_family" value="{$re.living_expenditure_family}"></td>
        </tr>
        <tr height="24">
          <td height="24" width="146">学生费用支出(年)</td>
          <td width="84"><span class="tuition_expenditure_family">{$re.tuition_expenditure_family}</span> <input type="text" name="tuition_expenditure_family" value="{$re.tuition_expenditure_family}"></td>
        </tr>
        <tr height="26">
          <td height="26" width="146">其他支出(年)</td>
          <td width="84"><span class="other_expenditure_family">{$re.other_expenditure_family}</span><input type="text" name="other_expenditure_family" value="{$re.other_expenditure_family}"></td>
        </tr>
        <tr height="26">
          <td rowspan="2" height="52" dir="RTL" width="100">上学期期末考试学生学习情况</td>
          <td dir="RTL" width="36">语文</td>
          <td width="35">数学</td>
          <td width="34">英语</td>
          <td>班级排名</td>
          <td>年级排名</td>
          <td colspan="3" width="158">班主任姓名及电话</td>
          <td colspan="2" width="230">　 <span class="teacher_phone">{$re.teacher_phone}</span> <input style="width:200px;" type="text" name="teacher_phone" value="{$re.teacher_phone}"></td>
        </tr>
        <tr height="26">
          <td height="26" dir="RTL" width="36"><span class="chinese_curricula">{$re.chinese_curricula}</span><input type="text" name="chinese_curricula" value="{$re.chinese_curricula}"></td>
          <td dir="RTL" width="35">　 <span class="math_curricula">{$re.math_curricula}</span> <input type="text" name="math_curricula" value="{$re.math_curricula}"></td>
          <td dir="RTL" width="34"><span class="english_curricula">{$re.english_curricula}</span> <input type="text" name="english_curricula" value="{$re.english_curricula}"></td></td>
          <td width="61"><span class="class_rank">{$re.class_rank}</span> <input type="text" name="class_rank" value="{$re.class_rank}"></td>
          <td width="54"><span class="school_rank">{$re.school_rank}</span> <input type="text" name="school_rank" value="{$re.school_rank}"></td>
          <td colspan="3" align="left" width="158">班主任对学生的综合评价</td>
          <td colspan="2" width="230"><span class="teacher_remark">{$re.teacher_remark}</span> <input style="width:300px;" type="text" name="teacher_remark" value="{$re.teacher_remark}"></td>
        </tr>
      </table>

        </div>
      </div>
      <div class="btn_wrap" style="z-index:999;text-align: center;">
        <div class="btn_wrap_pd">
         
          <a class="btn repush btn_error" href="javascript:;"><i class="fa fa-mail-reply-all"></i>重新上传</a>
            <a class="btn btn_success rechange" href="javascript:;"><i class="fa fa-edit"></i>确认修改</a>
             <a class="btn btn_warning deletethis" href="javascript:;"><i class="fa fa-warning"></i>删除此条</a>
              <a class="btn btn_submit ExcelToSql" href="{:U('Admin/Excel/ExcelToSql',array('solt'=>$solt))}"><i class="fa fa-print"></i>检查无误入库处理</a>
              <script type="text/javascript">
              //入库
              $('.ExcelToSql').click(function(event) {
                  if($('#comfirmold').attr('change')=="true"){
                    $(this).attr('hrefdata', $(this).attr('href'));
                    $(this).attr('href', 'javascript:;');
                  layer.confirm('系统检测到您有修改表单，您确定不修改就提交入库吗？', {
                        btn: ['确定','我再检查下'] //按钮
                    }, function(){


                       $('.layui-layer-close').click();
                       window.location.href = $('.ExcelToSql').attr('hrefdata');
                    }, function(){
                      $('.ExcelToSql').attr('href', $('.ExcelToSql').attr('hrefdata'));
                        
                    });
               
                }else{
                  $(this).attr('href', $(this).attr('hrefdata'));
                }


              });
              //删除
              $('.deletethis').click(function(event) {
                layer.confirm('确定要删除此条数据吗？', {
                      btn: ['确定','取消'] //按钮
                  }, function(){
                    var id = "{$id}";
                        $.ajax({
                        url: "{:U('Ajax/Excel/delField')}",
                        type: 'post',
                        dataType: 'html',
                        data: {id: id},
                        success:function(d){
                          if(d==1){
                            window.location.href = "Admin/Excel/comfirmOld/solt/<?php echo $_GET['solt']; ?>";
                          }else{
                            cmzAlert('出错了！',2)
                          }
                        }
                      })
                  }, function(){
                      // layer.msg('也可以这样', {
                      //     time: 20000, //20s后自动关闭
                      //     btn: ['明白了', '知道了']
                      // });
                  });
              });


              //值改变提示！
             $("#comfirmold input").change(function(event) {
               change()
             });
             $("#comfirmold textarea").change(function(event) {
              change()
             });
              $("#comfirmold select").change(function(event) {
              change()
             });
            function change(){
               $('#comfirmold').attr('change', 'true');
            }

            //分页跳转时进行判断
            $('#pages a').click(function(event) {
              $(this).addClass('choosees').siblings().removeClass('choosees');
              // alert(num)
              if($('#comfirmold').attr('change')=="true"){
                $(this).attr('hrefdata', $(this).attr('href'));
                $(this).attr('href', 'javascript:;');
                layer.confirm('系统检测到您有修改表单，您确定不修改就离开此页面吗？', {
                      btn: ['确定','我再检查下'] //按钮
                  }, function(){


                     $('.layui-layer-close').click();
                     window.location.href = $('.choosees').attr('hrefdata');
                  }, function(){
                       $('.choosees').attr('href', $('.choosees').attr('hrefdata'));
                  });
             
              }else{
                $(this).attr('href', $(this).attr('hrefdata'));
              }
              
            });
              
              //清空重新上传
              $('.repush').click(function(event) {
                var solt = "{$solt}";
                var url = "{:U('Excel/publishOld')}";
                  //询问框
                  layer.confirm('您确定要重新上传吗？重新上传会清除您现在的上传资料？', {
                      btn: ['确定','取消'] //按钮
                  }, function(){
                      $.ajax({
                        url: "{:U('Ajax/Excel/cleanInput')}",
                        type: 'post',
                        dataType: 'html',
                        data: {solt: solt},
                        success:function(d){
                          if(d==1){
                            window.location.href = url;
                          }else{
                            cmzAlert('出错了！',2)
                          }
                        }
                      })
                      
                      
                  }, function(){
                      // layer.msg('也可以这样', {
                      //     time: 20000, //20s后自动关闭
                      //     btn: ['明白了', '知道了']
                      // });
                  });
               // 
              });
  //检测表单是否有修改
    $('.rechange').click(function(event) {
      $.ajax({
        url: "{:U('Ajax/Excel/changeField')}",
        type: 'post',
        dataType: 'html',
        data:$('#comfirmold').serialize(),
        success:function(d){
          if(d){
             layer.confirm('修改成功', {
                      btn: ['确定'] //按钮
                  }, function(){
                window.location.reload();
                      
                  }, function(){
                     
                  });
      
            
          }
          
        }
      })
      
    });
</script>
        </div>
      </div>
    </form>
  </div>
</block>
<block name="script">
  <script type="text/javascript">
  // //双击修改
  // $('form span').dblclick(function(event) {
  //   var name = $(this).attr('class');
  //   $(this).hide();
  //   $('input[name='+name+']').show();
  //  $('textarea[name='+name+']').show();
  // });
  // //双击保存
  // $('form input').dblclick(function(event) {
  //   var name =$(this).attr('name');
  //   var values = $(this).val();
  //   var id = {$id};
  //   $(this).hide();
  //   $('span.'+name).show()
  //   $('span.'+name).html(values);
  //   $.ajax({
  //     url: "{:U('Ajax/Apply/inputExcel')}",
  //     type: 'post',
  //     dataType: 'json',
  //     data: {id: id,key:name,values:values},
  //     success:function(){

  //     }
  //   })

 
    

  // });

  // $('form textarea').dblclick(function(event) {
  //   var name =$(this).attr('name');
  //   var values = $(this).val();
  //   var id = {$id};
  //   $(this).hide();
  //   $('span.'+name).show()
  //   $('span.'+name).html(values);
  //   $.ajax({
  //     url: "{:U('Ajax/Apply/inputExcel')}",
  //     type: 'post',
  //     dataType: 'json',
  //     data: {id: id,key:name,values:values},
  //     success:function(){

  //     }
  //   })
    
 
    

  // });
</script>
</block>



